package com.windystory.wslibrary.base.photoShow;

import android.os.Bundle;
import android.view.View;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.windystory.wslibrary.R;
import com.windystory.wslibrary.base.fragment.BaseFragment;
import com.windystory.wslibrary.util.event.Event;


/**
 * ShowPicsFragment 图片显示
 * Created by windystory on 08/23/2019.
 */
public class ShowPicsErrorFragment extends BaseFragment {

    private PinchImageView guideIMG;


    public static ShowPicsErrorFragment newInstance(String imageRes) {
        ShowPicsErrorFragment fragment = new ShowPicsErrorFragment();

        Bundle args = new Bundle();
        args.putString("res", imageRes);
        fragment.setArguments(args);

        return fragment;
    }


    @Override
    protected void initData() {
        RequestOptions options = new RequestOptions();
        options.error(R.drawable.pic_load_error);
        Glide.with(getActivity()).load(getArguments().getString("res")).apply(options).into(guideIMG);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_guide;
    }

    @Override
    protected void initView(View v) {
        guideIMG = v.findViewById(R.id.guideIMG);
    }

    @Override
    protected void onEventDealWith(Event eventConfig) {

    }
}
